Structured program theorem